home *** CD-ROM | disk | FTP | other *** search
- /*
-
- Nullsoft WASABI Source File License
-
- Copyright 1999-2001 Nullsoft, Inc.
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-
-
- Brennan Underwood
- brennan@nullsoft.com
-
- */
-
- /*
- ** JNetLib
- ** Copyright (C) 2000-2001 Nullsoft, Inc.
- ** Author: Justin Frankel
- ** File: netinc.h - network includes and portability defines (used internally)
- ** License: see jnetlib.h
- */
-
- #ifndef _NETINC_H_
- #define _NETINC_H_
-
- #ifdef _WIN32
-
- #include <windows.h>
- #include <stdio.h>
- #include <time.h>
- #define strcasecmp(x,y) stricmp(x,y)
- #define ERRNO (WSAGetLastError())
- #define SET_SOCK_BLOCK(s,block) { unsigned long __i=block?0:1; ioctlsocket(s,FIONBIO,&__i); }
- #define EWOULDBLOCK WSAEWOULDBLOCK
- #define EINPROGRESS WSAEWOULDBLOCK
- typedef int socklen_t;
-
- #else
-
- #ifndef THREAD_SAFE
- #define THREAD_SAFE
- #endif
- #ifndef _REENTRANT
- #define _REENTRANT
- #endif
- #include <pthread.h>
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <sys/socket.h>
- #include <netinet/in.h>
- #include <sys/time.h>
- #include <arpa/inet.h>
- #include <netdb.h>
- #include <stdarg.h>
- #include <stdio.h>
- #include <fcntl.h>
- #include <unistd.h>
- #include <signal.h>
- #include <stdlib.h>
- #include <errno.h>
- #include <string.h>
-
- #define ERRNO errno
- #define closesocket(s) close(s)
- #define SET_SOCK_BLOCK(s,block) { int __flags; if ((__flags = fcntl(s, F_GETFL, 0)) != -1) { if (!block) __flags |= O_NONBLOCK; else __flags &= ~O_NONBLOCK; fcntl(s, F_SETFL, __flags); } }
-
- #define stricmp(x,y) strcasecmp(x,y)
- #define strnicmp(x,y,z) strncasecmp(x,y,z)
- #define wsprintf sprintf
-
- #endif // !_WIN32
-
- #ifndef INADDR_NONE
- #define INADDR_NONE 0xffffffff
- #endif
-
- #ifndef INADDR_ANY
- #define INADDR_ANY 0
- #endif
-
- #ifndef SHUT_RDWR
- #define SHUT_RDWR 2
- #endif
-
- #endif //_NETINC_H_
-